home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / usr_-_Usr_Files / INCLUDE / LANGINFO.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  7KB  |  262 lines

  1. /* nl_langinfo -- Access to locale-dependent parameters.
  2. Copyright (C) 1995, 1996 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4.  
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9.  
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. Library General Public License for more details.
  14.  
  15. You should have received a copy of the GNU Library General Public
  16. License along with the GNU C Library; see the file COPYING.LIB.  If
  17. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  18. Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef _LANGINFO_H
  21. #define    _LANGINFO_H 1
  22.  
  23. #include <locale.h>        /* Define the LC_* category names.  */
  24.  
  25. __BEGIN_DECLS
  26.  
  27. /* Construct an `nl_item' value for `nl_langinfo' from a locale category
  28.    (LC_*) and an item index within the category.  Some code may depend on
  29.    the item values within a category increasing monotonically with the
  30.    indices.  */
  31. #define _NL_ITEM(category, index)    (((category) << 16) | (index))
  32.  
  33. /* Extract the category and item index from a constructed `nl_item' value.  */
  34. #define _NL_ITEM_CATEGORY(item)        ((int) (item) >> 16)
  35. #define _NL_ITEM_INDEX(item)        ((int) (item) & 0xffff)
  36.  
  37.  
  38. /* Enumeration of locale items that can be queried with `nl_langinfo'.  */
  39. typedef enum
  40. {
  41.   /* LC_TIME category: date and time formatting.  */
  42.  
  43. #ifdef __SVR4_I386_ABI_L1__
  44.   /* Long-named days of the week. */
  45.   DAY_1 = 1,            /* 1 Sunday */
  46.   DAY_2,            /* 2 Monday */
  47.   DAY_3,            /* 3 Tuesday */
  48.   DAY_4,            /* 4 Wednesday */
  49.   DAY_5,            /* 5 Thursday */
  50.   DAY_6,            /* 6 Friday */
  51.   DAY_7,            /* 7 Saturday */
  52.  
  53.   /* Abbreviated days of the week. */
  54.   ABDAY_1,            /* 8 Sun */
  55.   ABDAY_2,            /* 9 Mon */
  56.   ABDAY_3,            /* 10 Tue */
  57.   ABDAY_4,            /* 11 Wed */
  58.   ABDAY_5,            /* 12 Thu */
  59.   ABDAY_6,            /* 13 Fri */
  60.   ABDAY_7,            /* 14 Sat */
  61.  
  62. #else /*!__SVR4_I386_ABI_L1__*/
  63.  
  64.   /* Abbreviated days of the week. */
  65.   ABDAY_1 = _NL_ITEM (LC_TIME, 0), /* Sun */
  66.   ABDAY_2,
  67.   ABDAY_3,
  68.   ABDAY_4,
  69.   ABDAY_5,
  70.   ABDAY_6,
  71.   ABDAY_7,
  72.  
  73.   /* Long-named days of the week. */
  74.   DAY_1,            /* Sunday */
  75.   DAY_2,            /* Monday */
  76.   DAY_3,            /* Tuesday */
  77.   DAY_4,            /* Wednesday */
  78.   DAY_5,            /* Thursday */
  79.   DAY_6,            /* Friday */
  80.   DAY_7,            /* Saturday */
  81.  
  82. #endif /*!__SVR4_I386_ABI_L1__*/
  83.  
  84.  
  85. #ifdef __SVR4_I386_ABI_L1__
  86.   /* Abbreviated month names.  */
  87.   MON_1,            /* 15 = Jan */
  88.   MON_2,            /* 16 = Feb */
  89.   MON_3,            /* 17 = Mar */
  90.   MON_4,            /* 18 = Apr */
  91.   MON_5,            /* 19 = May */
  92.   MON_6,            /* 20 = Jun */
  93.   MON_7,            /* 21 = Jul */
  94.   MON_8,            /* 22 = Aug */
  95.   MON_9,            /* 23 = Sep */
  96.   MON_10,            /* 24 = Oct */
  97.   MON_11,            /* 25 = Nov */
  98.   MON_12,            /* 26 = Dec */
  99.  
  100.   /* Long month names.  */
  101.   ABMON_1,            /* 27 = January */
  102.   ABMON_2,            /* 28 = February */
  103.   ABMON_3,            /* 29 = March */
  104.   ABMON_4,            /* 30 = April */
  105.   ABMON_5,            /* 31 = May */
  106.   ABMON_6,            /* 32 = June */
  107.   ABMON_7,            /* 33 = July */
  108.   ABMON_8,            /* 34 = August */
  109.   ABMON_9,            /* 35 = September */
  110.   ABMON_10,            /* 36 = October */
  111.   ABMON_11,            /* 37 = November */
  112.   ABMON_12,            /* 38 = December */
  113.  
  114.   RADIXCHAR,            /* 39 */
  115.   THOUSEP,            /* 40 */
  116.   YESSTR,            /* 41 = Output string for ``yes''.  */
  117.   NOEXPR,            /* 42 = Regex matching ``no'' input.  */
  118.   CRNCYSTR,            /* 43 */
  119.  
  120.   D_T_FMT,            /* 44 = Date and time format for strftime.  */
  121.   D_FMT,            /* 45 = Date format for strftime.  */
  122.   T_FMT,            /* 46 = Time format for strftime.  */
  123.  
  124.   AM_STR,            /* 47= Ante meridian string.  */
  125.   PM_STR,            /* 48 = Post meridian string.  */
  126.  
  127. #else /*!__SVR4_I386_ABI_L1__*/
  128.   /* Abbreviated month names.  */
  129.   ABMON_1,            /* Jan */
  130.   ABMON_2,
  131.   ABMON_3,
  132.   ABMON_4,
  133.   ABMON_5,
  134.   ABMON_6,
  135.   ABMON_7,
  136.   ABMON_8,
  137.   ABMON_9,
  138.   ABMON_10,
  139.   ABMON_11,
  140.   ABMON_12,
  141.  
  142.   /* Long month names.  */
  143.   MON_1,            /* January */
  144.   MON_2,
  145.   MON_3,
  146.   MON_4,
  147.   MON_5,
  148.   MON_6,
  149.   MON_7,
  150.   MON_8,
  151.   MON_9,
  152.   MON_10,
  153.   MON_11,
  154.   MON_12,
  155.  
  156.   AM_STR,            /* Ante meridian string.  */
  157.   PM_STR,            /* Post meridian string.  */
  158.  
  159.   D_T_FMT,            /* Date and time format for strftime.  */
  160.   D_FMT,            /* Date format for strftime.  */
  161.   T_FMT,            /* Time format for strftime.  */
  162. #endif /*!__SVR4_I386_ABI_L1__*/
  163.  
  164.   T_FMT_AMPM,            /* 12-hour time format for strftime.  */
  165.  
  166.   ERA,                /* Alternate era.  */
  167.   ERA_YEAR,            /* Year in alternate era format.  */
  168.   ERA_D_FMT,            /* Date in alternate era format.  */
  169.   ALT_DIGITS,            /* Alternate symbols for digits.  */
  170.   ERA_D_T_FMT,            /* Date and time in alternate era format.  */
  171.   ERA_T_FMT,            /* Time in alternate era format.  */
  172.  
  173.   _NL_NUM_LC_TIME,        /* Number of indices in LC_TIME category.  */
  174.  
  175.   /* LC_COLLATE category: text sorting.
  176.      This information is accessed by the strcoll and strxfrm functions.
  177.      These `nl_langinfo' names are used only internally.  */
  178.   _NL_COLLATE_NRULES = _NL_ITEM (LC_COLLATE, 0),
  179.   _NL_COLLATE_RULES,
  180.   _NL_COLLATE_HASH_SIZE,
  181.   _NL_COLLATE_HASH_LAYERS,
  182.   _NL_COLLATE_TABLE_EB,
  183.   _NL_COLLATE_TABLE_EL,
  184.   _NL_COLLATE_UNDEFINED,
  185.   _NL_COLLATE_EXTRA_EB,
  186.   _NL_COLLATE_EXTRA_EL,
  187.   _NL_NUM_LC_COLLATE,
  188.  
  189.   /* LC_CTYPE category: character classification.
  190.      This information is accessed by the functions in <ctype.h>.
  191.      These `nl_langinfo' names are used only internally.  */
  192.   _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0),
  193.   _NL_CTYPE_TOUPPER_EB,
  194.   _NL_CTYPE_TOLOWER_EB,
  195.   _NL_CTYPE_TOUPPER_EL,
  196.   _NL_CTYPE_TOLOWER_EL,
  197.   _NL_CTYPE_CLASS32,
  198.   _NL_CTYPE_NAMES_EB,
  199.   _NL_CTYPE_NAMES_EL,
  200.   _NL_CTYPE_HASH_SIZE,
  201.   _NL_CTYPE_HASH_LAYERS,
  202.   _NL_CTYPE_CLASS_NAMES,
  203.   _NL_CTYPE_MAP_NAMES,
  204.   _NL_CTYPE_WIDTH,
  205.   _NL_NUM_LC_CTYPE,
  206.  
  207.   /* LC_MONETARY category: formatting of monetary quantities.
  208.      These items each correspond to a member of `struct lconv',
  209.      defined in <locale.h>.  */
  210.   INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0),
  211.   CURRENCY_SYMBOL,
  212.   MON_DECIMAL_POINT,
  213.   MON_THOUSANDS_SEP,
  214.   MON_GROUPING,
  215.   POSITIVE_SIGN,
  216.   NEGATIVE_SIGN,
  217.   INT_FRAC_DIGITS,
  218.   FRAC_DIGITS,
  219.   P_CS_PRECEDES,
  220.   P_SEP_BY_SPACE,
  221.   N_CS_PRECEDES,
  222.   N_SEP_BY_SPACE,
  223.   P_SIGN_POSN,
  224.   N_SIGN_POSN,
  225.   _NL_NUM_LC_MONETARY,
  226.  
  227.   /* LC_NUMERIC category: formatting of numbers.
  228.      These also correspond to members of `struct lconv'; see <locale.h>.  */
  229.   DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0),
  230.   THOUSANDS_SEP,
  231.   GROUPING,
  232.   _NL_NUM_LC_NUMERIC,
  233.  
  234.   YESEXPR = _NL_ITEM (LC_MESSAGES, 0), /* Regex matching ``yes'' input.  */
  235. #ifndef __SVR4_I386_ABI_L1__
  236.   NOEXPR,            /* Regex matching ``no'' input.  */
  237.   YESSTR,            /* Output string for ``yes''.  */
  238. #endif
  239.   NOSTR,            /* Output string for ``no''.  */
  240.   _NL_NUM_LC_MESSAGES,
  241.  
  242.   /* This marks the highest value used.  */
  243.   _NL_NUM
  244. } nl_item;
  245.  
  246.  
  247. /* XXX The SVR4 ABI defines nl_item as type int, declared in <nl_types.h>,
  248.   but the Linux C library declares it as an enum in <langinfo.h>. */
  249.  
  250. /* Return the current locale's value for ITEM.
  251.    If ITEM is invalid, an empty string is returned.
  252.  
  253.    The string returned will not change until `setlocale' is called;
  254.    it is usually in read-only memory and cannot be modified.  */
  255.  
  256. extern char *nl_langinfo __P ((nl_item item));
  257.  
  258.  
  259. __END_DECLS
  260.  
  261. #endif    /* langinfo.h */
  262.